﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using BF.Model;
using BF.Infrastructure;
using BF.IDAL;
using BF.IDAL.Dictionary;
using BF.IDAL.BaseSystem;

namespace BF.SQLServerDAL.Dictionary
{
    public class Dic_DictDAL : DALBase<dic_Dict, WSJD_BaseFrameworkEntities>, Idic_DictDAL
    {
        public Dic_DictDAL(IDatabaseFactory<WSJD_BaseFrameworkEntities> databaseFactory)
            : base(databaseFactory)
        { }        

        /// <summary>
        /// 获取排序后的集合 Ordery By sName Desc
        /// </summary>
        /// <param name="whereLam"></param>
        /// <returns></returns>
        public List<dic_Dict> GetDescList(Expression<Func<dic_Dict, bool>> whereLam)
        {
            var query = from p in DataContext.dic_Dict.Where(whereLam)
                        orderby p.sName 
                        select p;
            return query.ToList<dic_Dict>();
        }
    }
}
